package cn.clq.ymcc.feign;

import cn.clq.ymcc.domain.Login;
import cn.clq.ymcc.dto.RegisterDto;
import cn.clq.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import javax.validation.Valid;
import java.util.List;

/**
 * @author clqlongbao
 * @version 1.0
 * @description: TODO
 * @date 2022/7/25 20:13
 */
@Component
public class CourseOnSendMessageFeignClientFallBackFactory implements FallbackFactory<CourseOnSendMessageFeignClient> {
    @Override
    public CourseOnSendMessageFeignClient create(Throwable throwable) {
        return new CourseOnSendMessageFeignClient() {

            @Override
            public JSONResult sendSms(List<String> logininfo) {
                throwable.printStackTrace();
                return JSONResult.error("短信发送服务不可达");
            }

            @Override
            public JSONResult sendEmail(List<String> logininfo) {
                throwable.printStackTrace();
                return JSONResult.error("邮件发送服务不可达");
            }

            @Override
            public JSONResult sendStation(List<String> logininfo) {
                throwable.printStackTrace();
                return JSONResult.error("站内信发送服务不可达");
            }
        };
    }
}
